<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<!-- 
   1. 插槽的基本使用:<slot></slot>
   2. 设置默认值: <slot><button>按钮</button></slot>
   3. 如果有多个值作为替换元素，则会一起替换
 -->
<body>
    <div id="app">
        <cpn></cpn>
        <cpn>
            <span><strong>我是span</strong></span>
        </cpn>
        <cpn>
            <i>我是i</i>
            <div>我是div</div>
            <input type="text" placeholder="请输入值">
        </cpn>
        <cpn></cpn>
    </div>

    <template id="cpn">
        <div>
            <h2>我是组件</h2>
            <p>重庆对外经贸学院</p>
            <!-- button是默认值 -->
            <slot><button>按钮</button></slot>
        </div>
    </template>
    <script src= '../js/vue.js'></script>
    <script>
        const cpn = {
            template:'#cpn'
        }

        const app = new Vue({
            el:'#app',
            data:{

            },
            components:{
                cpn
            },
            methods:{
                
            }
        })
    </script>
</body>
</html>